package com.Archive.secondWeek;

public class cardInfo {

    //数据初始化
    private int[] ID = new int[]{1, 0, 3, 4, 5, 6, 7, 8, 9, 10, 11};
    private String[] name = new String[11];
    private String[] password = new String[11];
    private long[] overage = new long[11];
    private String[] currency = new String[11];
    private String[] openDate = new String[11];
    private String[] lastDate = new String[11];

    //初始化表格
    public void tableInitialization() {
        int i = 0;
    }

    //空白查找
    public int checkSpace() {
        int i = 0;
        for (; i < ID.length; i++) {
            if (ID[i] == 0) {
                break;
            }
        }
        if (i == ID.length && ID[i] == 0) {
            System.out.println("数据库溢出");
            i = 0;
        }
        return i - 1;
    }



    public void show(int i) {
        if (i == 0) {
            for (i = 0; i < ID.length; i++) {
                System.out.print(ID[i] + "\t" + name[i] + "\t" + password[i] + "\t" + currency[i] + "\t" + overage[i] + "\t" + openDate[i] + "\t" + lastDate[i] + "\n");
            }
        } else if (i > 0 && i < ID.length) {
            System.out.print(ID[i] + "\t" + name[i] + "\t" + password[i] + "\t" + overage[i] + "\t" + currency[i] + "\t" + openDate[i] + "\t" + lastDate[i] + "\n");
        }
    }
}
